3.450 \(\int \frac {\sec ^5(c+d x)}{a+b \tan ^2(c+d x)} \, dx\)

Optimal. Leaf size=90 \[ \frac {(a-b)^{3/2} \tanh ^{-1}\left (\frac {\sqrt {a-b} \sin (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} b^2 d}-\frac {(2 a-3 b) \tanh ^{-1}(\sin (c+d x))}{2 b^2 d}+\frac {\tan (c+d x) \sec (c+d x)}{2 b d} \]

[Out]

-1/2*(2*a-3*b)*arctanh(sin(d*x+c))/b^2/d+(a-b)^(3/2)*arctanh(sin(d*x+c)*(a-b)^(1/2)/a^(1/2))/b^2/d/a^(1/2)+1/2
*sec(d*x+c)*tan(d*x+c)/b/d

________________________________________________________________________________________

Rubi [A]  time = 0.14, antiderivative size = 90, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3676, 414, 522, 206, 208} \[ \frac {(a-b)^{3/2} \tanh ^{-1}\left (\frac {\sqrt {a-b} \sin (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} b^2 d}-\frac {(2 a-3 b) \tanh ^{-1}(\sin (c+d x))}{2 b^2 d}+\frac {\tan (c+d x) \sec (c+d x)}{2 b d} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^5/(a + b*Tan[c + d*x]^2),x]

[Out]

-((2*a - 3*b)*ArcTanh[Sin[c + d*x]])/(2*b^2*d) + ((a - b)^(3/2)*ArcTanh[(Sqrt[a - b]*Sin[c + d*x])/Sqrt[a]])/(
Sqrt[a]*b^2*d) + (Sec[c + d*x]*Tan[c + d*x])/(2*b*d)

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 208

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-(a/b), 2]*ArcTanh[x/Rt[-(a/b), 2]])/a, x] /; FreeQ[{a,
b}, x] && NegQ[a/b]

Rule 414

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> -Simp[(b*x*(a + b*x^n)^(p + 1)*(
c + d*x^n)^(q + 1))/(a*n*(p + 1)*(b*c - a*d)), x] + Dist[1/(a*n*(p + 1)*(b*c - a*d)), Int[(a + b*x^n)^(p + 1)*
(c + d*x^n)^q*Simp[b*c + n*(p + 1)*(b*c - a*d) + d*b*(n*(p + q + 2) + 1)*x^n, x], x], x] /; FreeQ[{a, b, c, d,
 n, q}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] &&  !( !IntegerQ[p] && IntegerQ[q] && LtQ[q, -1]) && IntBinomial
Q[a, b, c, d, n, p, q, x]

Rule 522

Int[((e_) + (f_.)*(x_)^(n_))/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[(b*e - a*f
)/(b*c - a*d), Int[1/(a + b*x^n), x], x] - Dist[(d*e - c*f)/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a
, b, c, d, e, f, n}, x]

Rule 3676

Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_))^(p_.), x_Symbol] :> With[{ff = F
reeFactors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[ExpandToSum[b*(ff*x)^n + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 -
ff^2*x^2)^((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n/2] && IntegerQ[p]

Rubi steps

\begin {align*} \int \frac {\sec ^5(c+d x)}{a+b \tan ^2(c+d x)} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {1}{\left (1-x^2\right )^2 \left (a-(a-b) x^2\right )} \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac {\sec (c+d x) \tan (c+d x)}{2 b d}+\frac {\operatorname {Subst}\left (\int \frac {-a+2 b+(-a+b) x^2}{\left (1-x^2\right ) \left (a+(-a+b) x^2\right )} \, dx,x,\sin (c+d x)\right )}{2 b d}\\ &=\frac {\sec (c+d x) \tan (c+d x)}{2 b d}-\frac {(2 a-3 b) \operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (c+d x)\right )}{2 b^2 d}+\frac {(a-b)^2 \operatorname {Subst}\left (\int \frac {1}{a+(-a+b) x^2} \, dx,x,\sin (c+d x)\right )}{b^2 d}\\ &=-\frac {(2 a-3 b) \tanh ^{-1}(\sin (c+d x))}{2 b^2 d}+\frac {(a-b)^{3/2} \tanh ^{-1}\left (\frac {\sqrt {a-b} \sin (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} b^2 d}+\frac {\sec (c+d x) \tan (c+d x)}{2 b d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 1.38, size = 207, normalized size = 2.30 \[ \frac {-\frac {2 (a-b)^{3/2} \log \left (\sqrt {a}-\sqrt {a-b} \sin (c+d x)\right )}{\sqrt {a}}+\frac {2 (a-b)^{3/2} \log \left (\sqrt {a-b} \sin (c+d x)+\sqrt {a}\right )}{\sqrt {a}}+2 (2 a-3 b) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+2 (3 b-2 a) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )+\frac {b}{\left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {b}{\left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )^2}}{4 b^2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^5/(a + b*Tan[c + d*x]^2),x]

[Out]

(2*(2*a - 3*b)*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 2*(-2*a + 3*b)*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/
2]] - (2*(a - b)^(3/2)*Log[Sqrt[a] - Sqrt[a - b]*Sin[c + d*x]])/Sqrt[a] + (2*(a - b)^(3/2)*Log[Sqrt[a] + Sqrt[
a - b]*Sin[c + d*x]])/Sqrt[a] + b/(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])^2 - b/(Cos[(c + d*x)/2] + Sin[(c + d*x
)/2])^2)/(4*b^2*d)

________________________________________________________________________________________

fricas [A]  time = 0.50, size = 292, normalized size = 3.24 \[ \left [-\frac {2 \, {\left (a - b\right )} \sqrt {\frac {a - b}{a}} \cos \left (d x + c\right )^{2} \log \left (-\frac {{\left (a - b\right )} \cos \left (d x + c\right )^{2} + 2 \, a \sqrt {\frac {a - b}{a}} \sin \left (d x + c\right ) - 2 \, a + b}{{\left (a - b\right )} \cos \left (d x + c\right )^{2} + b}\right ) + {\left (2 \, a - 3 \, b\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (2 \, a - 3 \, b\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, b \sin \left (d x + c\right )}{4 \, b^{2} d \cos \left (d x + c\right )^{2}}, -\frac {4 \, {\left (a - b\right )} \sqrt {-\frac {a - b}{a}} \arctan \left (\sqrt {-\frac {a - b}{a}} \sin \left (d x + c\right )\right ) \cos \left (d x + c\right )^{2} + {\left (2 \, a - 3 \, b\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (2 \, a - 3 \, b\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, b \sin \left (d x + c\right )}{4 \, b^{2} d \cos \left (d x + c\right )^{2}}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^5/(a+b*tan(d*x+c)^2),x, algorithm="fricas")

[Out]

[-1/4*(2*(a - b)*sqrt((a - b)/a)*cos(d*x + c)^2*log(-((a - b)*cos(d*x + c)^2 + 2*a*sqrt((a - b)/a)*sin(d*x + c
) - 2*a + b)/((a - b)*cos(d*x + c)^2 + b)) + (2*a - 3*b)*cos(d*x + c)^2*log(sin(d*x + c) + 1) - (2*a - 3*b)*co
s(d*x + c)^2*log(-sin(d*x + c) + 1) - 2*b*sin(d*x + c))/(b^2*d*cos(d*x + c)^2), -1/4*(4*(a - b)*sqrt(-(a - b)/
a)*arctan(sqrt(-(a - b)/a)*sin(d*x + c))*cos(d*x + c)^2 + (2*a - 3*b)*cos(d*x + c)^2*log(sin(d*x + c) + 1) - (
2*a - 3*b)*cos(d*x + c)^2*log(-sin(d*x + c) + 1) - 2*b*sin(d*x + c))/(b^2*d*cos(d*x + c)^2)]

________________________________________________________________________________________

giac [A]  time = 2.96, size = 131, normalized size = 1.46 \[ -\frac {\frac {{\left (2 \, a - 3 \, b\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right )}{b^{2}} - \frac {{\left (2 \, a - 3 \, b\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right )}{b^{2}} - \frac {4 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \arctan \left (-\frac {a \sin \left (d x + c\right ) - b \sin \left (d x + c\right )}{\sqrt {-a^{2} + a b}}\right )}{\sqrt {-a^{2} + a b} b^{2}} + \frac {2 \, \sin \left (d x + c\right )}{{\left (\sin \left (d x + c\right )^{2} - 1\right )} b}}{4 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^5/(a+b*tan(d*x+c)^2),x, algorithm="giac")

[Out]

-1/4*((2*a - 3*b)*log(abs(sin(d*x + c) + 1))/b^2 - (2*a - 3*b)*log(abs(sin(d*x + c) - 1))/b^2 - 4*(a^2 - 2*a*b
 + b^2)*arctan(-(a*sin(d*x + c) - b*sin(d*x + c))/sqrt(-a^2 + a*b))/(sqrt(-a^2 + a*b)*b^2) + 2*sin(d*x + c)/((
sin(d*x + c)^2 - 1)*b))/d

________________________________________________________________________________________

maple [B]  time = 0.71, size = 224, normalized size = 2.49 \[ \frac {\arctanh \left (\frac {\left (a -b \right ) \sin \left (d x +c \right )}{\sqrt {a \left (a -b \right )}}\right ) a^{2}}{d \,b^{2} \sqrt {a \left (a -b \right )}}-\frac {2 \arctanh \left (\frac {\left (a -b \right ) \sin \left (d x +c \right )}{\sqrt {a \left (a -b \right )}}\right ) a}{d b \sqrt {a \left (a -b \right )}}+\frac {\arctanh \left (\frac {\left (a -b \right ) \sin \left (d x +c \right )}{\sqrt {a \left (a -b \right )}}\right )}{d \sqrt {a \left (a -b \right )}}-\frac {1}{4 d b \left (-1+\sin \left (d x +c \right )\right )}-\frac {3 \ln \left (-1+\sin \left (d x +c \right )\right )}{4 d b}+\frac {\ln \left (-1+\sin \left (d x +c \right )\right ) a}{2 d \,b^{2}}-\frac {1}{4 d b \left (\sin \left (d x +c \right )+1\right )}+\frac {3 \ln \left (\sin \left (d x +c \right )+1\right )}{4 d b}-\frac {\ln \left (\sin \left (d x +c \right )+1\right ) a}{2 d \,b^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^5/(a+b*tan(d*x+c)^2),x)

[Out]

1/d/b^2/(a*(a-b))^(1/2)*arctanh((a-b)*sin(d*x+c)/(a*(a-b))^(1/2))*a^2-2/d/b/(a*(a-b))^(1/2)*arctanh((a-b)*sin(
d*x+c)/(a*(a-b))^(1/2))*a+1/d/(a*(a-b))^(1/2)*arctanh((a-b)*sin(d*x+c)/(a*(a-b))^(1/2))-1/4/d/b/(-1+sin(d*x+c)
)-3/4/d/b*ln(-1+sin(d*x+c))+1/2/d/b^2*ln(-1+sin(d*x+c))*a-1/4/d/b/(sin(d*x+c)+1)+3/4/d/b*ln(sin(d*x+c)+1)-1/2/
d/b^2*ln(sin(d*x+c)+1)*a

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^5/(a+b*tan(d*x+c)^2),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(b-a>0)', see `assume?` for mor
e details)Is b-a positive or negative?

________________________________________________________________________________________

mupad [B]  time = 13.76, size = 268, normalized size = 2.98 \[ -\frac {\left (\frac {\mathrm {atanh}\left (\frac {\sin \left (c+d\,x\right )\,\sqrt {a-b}}{\sqrt {a}}\right )\,{\left (a-b\right )}^{3/2}\,1{}\mathrm {i}}{2}-a^{3/2}\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )-a^{3/2}\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (2\,c+2\,d\,x\right )+\frac {\cos \left (2\,c+2\,d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (c+d\,x\right )\,\sqrt {a-b}}{\sqrt {a}}\right )\,{\left (a-b\right )}^{3/2}\,1{}\mathrm {i}}{2}\right )\,1{}\mathrm {i}}{\sqrt {a}\,b^2\,d\,\left (\frac {\cos \left (2\,c+2\,d\,x\right )}{2}+\frac {1}{2}\right )}-\frac {\left (\frac {\sqrt {a}\,\sin \left (c+d\,x\right )\,1{}\mathrm {i}}{2}+\frac {3\,\sqrt {a}\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2}+\frac {3\,\sqrt {a}\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (2\,c+2\,d\,x\right )}{2}\right )\,1{}\mathrm {i}}{\sqrt {a}\,b\,d\,\left (\frac {\cos \left (2\,c+2\,d\,x\right )}{2}+\frac {1}{2}\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(c + d*x)^5*(a + b*tan(c + d*x)^2)),x)

[Out]

- (((atanh((sin(c + d*x)*(a - b)^(1/2))/a^(1/2))*(a - b)^(3/2)*1i)/2 - a^(3/2)*atan((sin(c/2 + (d*x)/2)*1i)/co
s(c/2 + (d*x)/2)) - a^(3/2)*atan((sin(c/2 + (d*x)/2)*1i)/cos(c/2 + (d*x)/2))*cos(2*c + 2*d*x) + (cos(2*c + 2*d
*x)*atanh((sin(c + d*x)*(a - b)^(1/2))/a^(1/2))*(a - b)^(3/2)*1i)/2)*1i)/(a^(1/2)*b^2*d*(cos(2*c + 2*d*x)/2 +
1/2)) - (((a^(1/2)*sin(c + d*x)*1i)/2 + (3*a^(1/2)*atan((sin(c/2 + (d*x)/2)*1i)/cos(c/2 + (d*x)/2)))/2 + (3*a^
(1/2)*atan((sin(c/2 + (d*x)/2)*1i)/cos(c/2 + (d*x)/2))*cos(2*c + 2*d*x))/2)*1i)/(a^(1/2)*b*d*(cos(2*c + 2*d*x)
/2 + 1/2))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\sec ^{5}{\left (c + d x \right )}}{a + b \tan ^{2}{\left (c + d x \right )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**5/(a+b*tan(d*x+c)**2),x)

[Out]

Integral(sec(c + d*x)**5/(a + b*tan(c + d*x)**2), x)

________________________________________________________________________________________